package com.example.rae.base;

/**
 * @Author YangZeRong
 * @Date 2022/4/10 13:42
 * @Version 1.0
 */
public class BaseApiService {

    public ResponseBase setResultCustom(Integer code, String name) {
        return setResult(code, name, null);
    }

    // 返回错误
    public ResponseBase setResultError(String name) {
        return setResult(500, name, null);
    }

    // 返回成功
    public ResponseBase setResultSuccess(String name, Object data) {
        return setResult(200, name, data);
    }

    // 通用封装
    public ResponseBase setResult(Integer code, String name, Object data) {
        return new ResponseBase(code, name, data);
    }

}
